This page last changed on Sep 08, 2006 by bowens.

LESSON 2: Add a Dataset

Objective:
In this tutorial you will learn how to configure GeoServer to publish with Web Map Service (WMS) and Web Feature Service (WFS) protocols.

Loading and Configuring Data

  1. Start up GeoServer by going to the Start menu or by running startup.bat in the bin/ directory of your geoserver install.
  2. Use your web browser and navigate to:
    http://localhost:8080/geoserver/welcome.do

Step 1: Log In

  1. From the welcome page select the Config link located near the top left of the page:
  2. You will be asked to log in. The default username is admin an default passowrd is geoserver:
  3. Click Submit. This will take you back to the welcome page.

Step 2: Create a Data Store

  1. Click on Config again and you will be taken to the main config page.
  2. Select the Data link:
  3. Select the Stores link:

    You are now in the data store page. Data stores are essentially a location where data lives. It can be a shapefile or database location.
  4. Select the New link:
  5. On the 'Create New Data Store' page:
    1. Select Shapefile from the drop down list labeled DataStore Description.
    2. Enter the text countries into the text field labeled DataStore ID.
    3. Hit the New button.
      This takes you to the data store editor. Here we need to say where our shapefile is.
  6. On the DataStore Editor page:
    1. enter the path of your countries shapeflile (countries.shp).
      We have included it in your GeoServer install under (geoserver home)/data_dir/data/countries.shp
    2. Set the Namespace to topp.
    3. Leave the Description text area blank.
    4. Hit Submit.
  7. On the DataStore Configuration page, click the Apply button located in the upper left hand corner of the page.

Step 3: Create a Feature Type for Your Data

Feature Types are the different sets of data that are in your data location. For a shapefile there will onle be one, but if your DataStore was a database, you might have several data sets to choose from. Each one of these is a Feature Type.

  1. Head back to the Data Config page:
  2. Click on the FeatureType link on the Data Configuration page. This will take you to the FeatureType page.
  3. On the Feature Type page, click on the New button:
  4. On the Create New FeatureType page:
    1. From the drop down list select countries::countries
    2. Click New
  5. You are now at the FeatureType editor page.
    1. From the drop down list labeled Style, select polygon. This will determine how your features will be rendered.
    2. In the text field labeled SRS enter the value 4326. This is the Projection that your dataset is in. In this case, lat/lon.
    3. Hit the Generate button. This will generate the bounding box of the dataset.
    4. Now scroll down to the bottom and hit Submit.
  6. Finally, hit the Apply button on the left of the screen. Then hit the Save button to save all of the changes to disk.

Step 4: Preview Your Data

Lets head over to the Demo page of GeoServer and preview our data.
Open up this URL in your browser:
http://localhost:8080/geoserver/mapPreview.do
Or just navigate to the welcome page, and click on Demo then on Map Preview

Locate your topp:countries layer, then click on the Preview link to the right of it. After a few seconds you should see a your countries dataset!


Document generated by Confluence on Jan 16, 2008 23:27